import axios from "axios";
import { showMessage } from "@/utils";

const curl = axios.create({
  //  baseURL: import.meta.env.VITE_BASE_URL,
  timeout: 10000,
});

curl.interceptors.response.use((res) => {
  const code = res.data?.code;
  if (code !== 0) {
    showMessage({ content: res.data.msg, type: "error" });
    return null;
  }
  return res.data;
});

export default curl;
